DOC Remove defaults from parameter type descriptions#14100
DOC Remove defaults from parameter type descriptions#14100viranovskaya wants to merge 3 commits into
Conversation
drammock
left a comment
There was a problem hiding this comment.
thanks! a few minor comments
There was a problem hiding this comment.
missed this one. But: the default is in fact the string "no validation" so that should be added as a possible value
| `y_numeric`. | ||
|
|
||
| y : array-like of shape (n_samples,), default='no_validation' | ||
| y : array-like of shape (n_samples,) |
There was a problem hiding this comment.
the default is "no validation" so that should be added as a Literal value
| If return_filtered is True, data is bandpassed and projected onto the | ||
| SSD components. | ||
| n_fft : int (default None) | ||
| n_fft : int |
There was a problem hiding this comment.
| n_fft : int | |
| n_fft : int | None |
| Number of cycles in the Morlet wavelet. Fixed number | ||
| or one per frequency. | ||
| time_bandwidth : float, default None | ||
| time_bandwidth : float |
There was a problem hiding this comment.
| time_bandwidth : float | |
| time_bandwidth : float | None |
| ---------- | ||
| %(info)s Only necessary if ``scalings`` is a dict or None. | ||
| scalings : dict, str, default None | ||
| scalings : dict, str |
There was a problem hiding this comment.
| scalings : dict, str | |
| scalings : dict | str | None |
| The ``limit_depth_chs`` argument can take the following values: | ||
|
|
||
| * :data:`python:True` (default) | ||
| * : data:`python:True` |
There was a problem hiding this comment.
revert this change (it's not the param description line, it's part of the Notes section)
| module = inspect.getmodule(func) | ||
| if module is not None and module.__name__.startswith("mne."): | ||
| for param in FunctionDoc(func)["Parameters"]: | ||
| if bad_docstring_type.search(param.type): |
There was a problem hiding this comment.
this yielded one false positive at least (see comment above about Notes section); you may need to parse/decompose the docstring to only look at the first (logical) line of each param description.
| Number of cycles. Can be a fixed number (float) or one per frequency | ||
| (array-like). | ||
| sigma : float, default None | ||
| sigma : float |
There was a problem hiding this comment.
| sigma : float | |
| sigma : float | None |
| None means True for method='multitaper' and False for method='morlet'. | ||
| If True, make sure the wavelets have a mean of zero. | ||
| time_bandwidth : float, default None | ||
| time_bandwidth : float |
There was a problem hiding this comment.
| time_bandwidth : float | |
| time_bandwidth : float | None |
|
Thanks, I’ve addressed all of these. I added the missing literal and The checker already iterates over Local checks: 15 passed, 1 skipped; Ruff check and format check passed. |
Reference issue (if any)
Fixes #14095.
What does this implement/fix?
This moves default values out of parameter type descriptions and removes
optionalfrom the remaining public docstrings. Defaults remain in the parameter descriptions where needed.I also added a docstring test so these forms are caught in future changes.
Additional information
Tests:
pytest mne/tests/test_docstring_parameters.py: 15 passed, 1 skippedAI assistance: I used OpenAI Codex to locate the affected docstrings, apply the mechanical edits, and draft the regression test. I reviewed the complete diff and ran the checks listed above.